/*
 * FileHandler.h
 *
 *  Created on: 15-Oct-2013
 *      Author: pridhvi
 */

#ifndef FILEHANDLER_H_
#define FILEHANDLER_H_
#include "../Global/BaseEntity.h"
#include <fstream>
#include <sys/stat.h>
#include <sys/types.h>
#include <fcntl.h>
#include <unistd.h>
#include "../dependency/debug.h"
#include "../Global/GlobalVar.h"
#include "../BufferManager/BufferUtility.h"

using namespace std;
class FileHandler {
	int _fd;
public:
	FileHandler();
	virtual ~FileHandler();
	STATUS_CODE createFile(string dbName);
	STATUS_CODE openFile(string dbName);
	STATUS_CODE closeFile();
	STATUS_CODE deleteFile(string dbName);
	STATUS_CODE readPage(int pageNo,int pageSize,char *pageData);
	STATUS_CODE writePage(int pageNo,int pageSize,char *pageData);

};



#endif /* FILEHANDLER_H_ */
